﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DayuCode.Designer.Entity
{
    public class HDataTable
	{
		public long? Id { get; set; }
		public string TableName { get; set; }
		public string TableAliasName { get; set; }
		public string ClassName { get; set; }
		public int? Ordnum { get; set; }
		public long? FuncId { get; set; }
		public string TableCaption { get; set; }
		public string ViewSql { get; set; }
		public string TableRelationSubtype { get; set; }
		public string TableRelationSubtypeCaption { get; set; }
		public bool? Recursion { get; set; }

		public string IdColumnName { get; set; }
		public string NameColumnName { get; set; }
		public string ParentIdColumnName { get; set; }
		public string OrderColumnName { get; set; }
		public string FilterColumnName { get; set; }

		public string CreateUser { get; set; }
		public string BeanName { get; set; }
		public string CreateTimeStr { get; set; }
		public bool? HasQMoneyYuanType { get; set; }
		public bool? HasQMoneyWanYuanType { get; set; }
		public string AttachmentBusinessIdColumn { get; set; }
		public string AttachmentIdColumn { get; set; }
		public string AttachmentNameColumn { get; set; }
		public string AttachmentTableName { get; set; }
		public string AttachmentOrderColumn { get; set; }
		public string AttachmentType { get; set; }
		public string AttachmentTypeCaption { get; set; }		
		public string TableNameAsClassName { get; set; }
		public bool? HasQPercentType { get; set; }
		public string TableDesc { get; set; }
		public string IdPropJavaType { get; set; }
		public string IdPropName { get; set; }
		public bool? HasQNumberType { get; set; }

		public bool? UseRowLock { get; set; }
		public bool? UseMasterLock { get; set; }

		public string ForeignColumnName { get; set; }
		public long? ForeignTableId { get; set; }
		//public string ForeignTableName { get; set; }

		public List<HDataColumn> Columns { get; set; }

		public override string ToString()
        {
			if (TableName == null) return "";
			if (string.IsNullOrWhiteSpace(TableCaption) || TableName.Equals(TableCaption, StringComparison.CurrentCultureIgnoreCase)) return TableName;
			return TableName + "(" + TableCaption + ")";
        }
    }
}
